package com.ck.print.demo.printbridge.message.qzcmd;

import cn.hutool.core.lang.UUID;
import com.google.gson.Gson;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * "params": {
 * "printerNames": [
 * null
 * ],
 * "flavor": "plain"
 * },
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class PrinterListenCmd extends ABaseCmd {
    private PrinterListenParams params;

    public PrinterListenCmd(String uid) {
        super();
        this.uid = uid;
        this.call = "printers.startListening";
        this.params = new PrinterListenParams();
    }

    @Data
    public static class PrinterListenParams {
        private String[] printerNames = new String[]{null};
        private String flavor = "plain";
    }

    public static void main(String[] args) {
        PrinterListenCmd cmd = new PrinterListenCmd(UUID.fastUUID().toString(Boolean.TRUE));
        Gson gson = new Gson();
        System.out.println(gson.toJson(cmd));
    }
}
